import axios from 'axios'
import oauthClient from 'axios-oauth-client'
let base = 'http://localhost:27000';

const oauth2Http = (url, grant_type, client_id, client_secret, username, password, scope) => {
	let getAuthorizationCode = oauthClient.client(axios.create(), {
		url: `${base}${url}`,
		grant_type: grant_type || 'password',
		client_id: client_id,
		client_secret: client_secret,
		username: username,
		password: password,
		scope: scope
	});
	return  getAuthorizationCode();
}


export default{
	oauth2Http
}